package com.conference.dto;

import com.conference.entity.ConferenceUser;
import lombok.Data;

@Data
public class LoginResponse {
    private boolean success;
    private String token;
    private ConferenceUser user;
    private String message;
    private String roleText; // 用户角色文本描述

    public static LoginResponse success(String token, ConferenceUser user) {
        LoginResponse response = new LoginResponse();
        response.setSuccess(true);
        response.setToken(token);
        response.setUser(user);
        response.setRoleText(user.getPermissionId() == 1 ? "会议组织者" : "参会人员");
        return response;
    }

    public static LoginResponse error(String message) {
        LoginResponse response = new LoginResponse();
        response.setSuccess(false);
        response.setMessage(message);
        return response;
    }
} 